package mc823.rmi.farfetch.server;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import mc823.rmi.farfetch.common.RemoteCine;

public class RemoteCineImpl extends UnicastRemoteObject implements RemoteCine {

	protected RemoteCineImpl() throws RemoteException {
		// needed because the super ctor thorws exception.
	}

	public String getExample() throws RemoteException {
		return "Farfetch faaaaaaaar!!";
	}
	
	
	public static void main(String[] args){
		try {
			Registry r = LocateRegistry.getRegistry();
			r.bind("cine", new RemoteCineImpl());
			System.out.println("Server listening...");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
